    var eventNames = ['checking', 'noupdate', 'downloading', 'progress', 'updateready', 'cached', 'obsolete', 'error'];

    eventNames.forEach(function(eventName) {
      applicationCache.addEventListener(eventName, function(e) {
        console.log(eventName);
        console.log(e);
      }, false);
    });
